<!--
 @Description 新闻列表组件纯文字
 @author gaohailan
 @date 2022/11/25
-->
<template>
  <section class="news-list-style-eight">
    <section v-if="option.resource === undefined || option.resource !=='zl'" class="item-top">
      <section class="left-title etc3">{{ getMapping(item, 'mainTitle') || '' }}</section>
    </section>
    <section v-if="option.resource ==='zl'" class="item-bottom">
      <section class="left-txt2">
        <img v-if="item.fileType === 'WJLX_PPT'" src="./images/p.png" alt="">
        <img v-else-if="item.fileType === 'WJLX_PDF'" src="./images/ppt.png" alt="">
        <img v-else-if="item.fileType === 'WJLX_EXCEL'" src="./images/x.png" alt="">
        <img v-else-if="item.fileType === 'WJLX_WORD'" src="./images/w.png" alt="">
        <img v-else src="./images/w.png" alt="">
        <span v-if="getMapping(item, 'subjectName')" class="data-name">{{ getMapping(item, 'subjectName') }}</span>
      </section>
    </section>
    <section v-else class="item-bottom">
      <section class="left-txt">
        <span v-if="getMapping(item, 'publishTime')">{{ getMapping(item, 'publishTime') | newFormatTime }}</span>
        <img v-if="item.audioId" src="./images/news-audio.png" alt="">
      </section>
    </section>
  </section>
</template>
<script>
import mixins from '../mixins'

export default {
  name: 'NewsListStyleEight',
  mixins: [mixins],
  // components: { EmptyPage },
  props: {
    item: {
      type: Object,
      default() {
        return {}
      }
    },
    option: {
      type: Object,
      default() {
        return {}
      }
    }
  },
  data() {
    return {
      imgList: []
    }
  },
  created() {
    if (this.item.videoBigCoverImgId) {
      this.imgList = this.item.videoBigCoverImgId.split(',')
    }
  }
}
</script>
<style lang="scss">
@import '@/styles/utility/rem.scss';

.news-list-style-eight {
  box-sizing: border-box;
  padding: rem(20);
  position: relative;

  .item-top {
    flex: 1;

    .left-title {
      font-size: rem(30);
      font-weight: bold;
      text-align: left;
      color: #333333;
      line-height: 1.5;
    }
  }

  .item-bottom {
    flex: 1;
    padding-right: rem(10);

    .left-txt {
      margin-top: rem(10);
      font-size: rem(22);
      font-family: PingFang SC Regular, PingFang SC Regular-Regular;
      font-weight: 400;
      text-align: left;
      color: #999999;
      display: flex;
      align-items: center;
      justify-content: space-between;

      > img {
        width: rem(49);
        height: rem(49);
      }

      > span {
        display: inline-block;
        margin-right: rem(20);
      }
    }
    .left-txt2{
      display: flex;
      img {
        width: rem(28);
        height: rem(28);
      }
      .data-name {
        flex: 1;
        width: 0;
        margin-left: rem(22);
        font-size: rem(28);
        font-family: PingFang SC, PingFang SC-Regular;
        font-weight: 400;
        text-align: left;
        color: #333333;
      }
    }
  }
}
</style>
